package com.aaa.ssm.service.impl;

import com.aaa.ssm.dao.DicgchannelDao;
import com.aaa.ssm.entity.Dicgchannel;
import com.aaa.ssm.service.DicgchannelService;
import com.aaa.ssm.util.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ fileName:DicgchannelServiceImpl
 * @ description:
 * @ createTime:2023/4/3 10:36
 * @ version:1.0.0
 */
@Service
public class DicgchannelServiceImpl implements DicgchannelService {

    @Resource
    private DicgchannelDao dicgchannelDao;

    @Override
    public PageInfo queryAll(Page<Dicgchannel> page1) {
        PageHelper.startPage(page1.getPageNo(),page1.getPageSize());
        return new PageInfo(dicgchannelDao.querypage(page1.getData()));
    }

    @Override
    public int add(Dicgchannel dicgchannel) {
        return dicgchannelDao.add(dicgchannel);
    }

    @Override
    public int update(Dicgchannel dicgchannel) {
        return dicgchannelDao.update(dicgchannel);
    }

    @Override
    public int delete(String code) {
        return dicgchannelDao.delete(code);
    }
}
